package com.sz.biz.logistics.ord.service;

import com.sz.biz.logistics.ord.entity.BizOperationLog;
import com.sz.biz.trade.ord.entity.TrdOrderStatus;
import com.sz.biz.trade.ord.dto.TrdOrderFileRelDto;
import com.sz.biz.logistics.ord.dto.*;
import com.sz.biz.logistics.ord.entity.OrdOrder;
import com.sz.biz.logistics.ord.entity.OrdOrderTracking;
import com.sz.biz.logistics.ord.entity.OrdSubOrder;
import com.sz.biz.logistics.ord.entity.OrderStatus;
import com.sz.biz.logistics.ord.enums.OrdOperationLogEnum;

import java.util.List;
import java.util.Map;

/**
 * Package: com.sz.biz.logistics.ord.service<br>
 * Function: 物流订单
 * Author: yanhong.xiao.<br>
 * Date: 2017-10-10 15:49:00.
 */
public interface BizOperationLogService {

    /**
     * 保存操作日志
     *
     * @param module
     * @param subModule
     * @param logs
     */
    void saveOperationLog(String module, String subModule, List<BizOperationLog> logs, Integer accountId, Integer domainId);


    /**
     * 保存草稿操作日志
     */
    void saveOrdOperLogForDraftOrCommit(List<Integer> orderIds, Integer accountId, Integer domainId,OrdOperationLogEnum operationLogEnum);

    /**
     * 提交订单
     * 1.创建订单时，直接提交。  add,不在此方法中
     * 2 草稿编辑到提交。 update
     * 3 草稿列表直接提交，不在此方法中
     *
     * @param orderIds
     * @param oldOrderDtoMap
     * @param newOrderDtoMap
     * @param operType
     * @param accountId
     * @param domainId
     */
    void saveOrdOperLogForCommit(List<Integer> orderIds, Map<Integer, OrdOrderDto> oldOrderDtoMap, Map<Integer, OrdOrderDto> newOrderDtoMap, String operType, Integer accountId, Integer domainId);


    /**
     * 订单信息的修改
     *
     * @param orderIds
     * @param oldOrderDtoMap
     * @param newOrderDtoMap
     * @param operType
     * @param accountId
     * @param domainId
     */
    void saveOrdOperLogForUpdate(List<Integer> orderIds, Map<Integer, OrdOrderDto> oldOrderDtoMap, Map<Integer, OrdOrderDto> newOrderDtoMap, String operType, Integer accountId, Integer domainId);

    /**
     * 订单批量受理或者提交
     *
     * @param orderIds
     * @param operType
     * @param accountId
     * @param domainId
     * @return
     */
   void saveOrdOperLogForBatchAcceptOrSubmit(List<Integer> orderIds, String operType, Integer accountId, Integer domainId,OrdOperationLogEnum operationLogEnum);


    /**
     * 保存订单的操作日志
     *
     * @param orderId
     * @param newOrderDto
     * @param operType
     * @param eventTypeEnum
     */
  //  void saveOrdOperationLog(Integer orderId, OrdOrderDto oldOrderDto, OrdOrderDto newOrderDto, String operType, OrdOperationLogEnum eventTypeEnum);


    /**
     * 对比订单修改前后的差异
     *
     * @param oldOrderDto
     * @param newOrderDto
     * @return
     */
    List<OrdOperLogUpData> compareOrderDto(OrdOrderDto oldOrderDto, OrdOrderDto newOrderDto);

    /**
     * 保存订单物流更新的log
     *  @param orderId
     * @param originalSubOrder
     * @param subOrder
     * @param originalOrder
     * @param order
     * @param operType
     * @param eventTypeEnum
     */
    void saveOrdLogisInfoUpdateLog(Integer orderId, OrdSubOrder originalSubOrder, OrdSubOrder subOrder, OrdOrder originalOrder, OrdOrder order, String operType, OrdOperationLogEnum eventTypeEnum, OrdOrderTracking tracking, Integer accountId , Integer domainId);

    /**
     * 批量增加物流信息
     */
    void batchSaveLogisInfoForUpdateLog(List<OrdOrder> orderList, List<OrdSubOrder> subOrderList, List<OrdOrder> orderListForSub, String trackMessage, Map<String, OrderStatus> orderStatusMap,Integer accountId,Integer domainId);

    /**
     * 获取某个订单的操作日志
     *
     * @param orderId
     * @return
     */
    List<OrdOperLogDto> getLogsByOrderId(Integer orderId, String sort, Boolean asc);


    OrdOperLogData getById(Integer logId);

    /**
     * 批量从草稿到提交
     *
     * @param orderIds
     * @param operType
     */
    //void batchSaveSumitOrAcceptLog(List<String> orderIds, String operType, OrdOperationLogEnum operationLogEnum);

    /**
     * 订单的附件
     *
     * @param orderId
     * @param operType
     * @param fileDto
     */
    void saveOrderFileUpdateLog(Integer orderId, OrderStatus orderStatus, String operType, OrdOrderFileDto fileDto, Integer accountId, Integer domainId);
    /**
     * 贸易订单的附件
     *
     * @param trdOrderId
     * @param operType
     * @param trdOrderFileRelDto
     */
    void saveOrderFileUpdateLog(Integer trdOrderId, TrdOrderStatus trdOrderStatus, String operType, TrdOrderFileRelDto trdOrderFileRelDto, Integer accountId, Integer domainId);

}


